package com.yxe.controller;


import com.yxe.api.CommonResult;
import com.yxe.pojo.Room;
import com.yxe.service.RoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yang
 * @since 2022-12-08
 */
@Api(tags = "房间接口")
@RestController
@RequestMapping("/room")
public class RoomController {

    @Autowired
    private RoomService roomService;

    @ApiOperation("查询房间信息")
    @GetMapping("selectById")
    public CommonResult<Room> selectById(Integer roomId){

        Room room = roomService.selectById(roomId);

        CommonResult commonResult = CommonResult.success(room);
        commonResult.setData(room);

        return commonResult;
    }

}

